package com.example.fresh_fruit.controller;

import com.example.fresh_fruit.entity.Head;
import com.example.fresh_fruit.service.HeadService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author :飞天の鱼
 * @date : 2022/8/17 16:26
 */
@Slf4j
@RestController
@RequestMapping("/head")
public class HeadController {
    @Autowired
    private HeadService headService;

   @GetMapping("/selectAll")
   public List<Head> selectAll(){
       return headService.selectAll();
   }

   @PostMapping("/delete")
    public boolean delete(Integer id,Integer state){
       return headService.delete(id,state);
   }



}
